package com.ctfo.web.controller;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    private static Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    DiscoveryClient discoveryClient;

    @RequestMapping("/dc")
    public String dc() {

        String services = "service:" + discoveryClient.getServices();

        logger.info("service name: {}", services);

        return services;
    }
}
